package com.moon.utils;

public class DataSourceContextHolder {

    private static final ThreadLocal<String> DATASOURCE_KEY_CONTEXT_HOLDER = new ThreadLocal<>();

    public static void setDataSourceKey(String dataSourceKey) {
        DATASOURCE_KEY_CONTEXT_HOLDER.set(dataSourceKey);
    }

    public static String getDataSourceKey() {
        return DATASOURCE_KEY_CONTEXT_HOLDER.get();
    }

    public static void clear() {
        DATASOURCE_KEY_CONTEXT_HOLDER.remove();
    }
}
